package math.leetcode_9_math;

public class ReverseNumber {
    public boolean isPalindrome(int x) {
        // 过滤负数
        if(x < 0){
            return false;
        }
        int res = 0;
        int temp = x;
        while(x > 0){
            res = res * 10 + x % 10;
            x = x / 10;
        }
        return res == temp;
    }
}
